import { AdminUserType } from '@/api/auth/login/types'
import { MenuType } from '@/api/auth/menu/types'
import { IconNameType } from '@/types/type'
import { RouteRecordRaw } from 'vue-router'

export type LayoutModeType = 'Default' | 'Classic' | 'Horizontal' | 'Vertical'
export type GreyOrColorWeakType = 'isGrey' | 'isColorWeak'
export type SizeType = 'large' | 'default' | 'small'
export type LogoWhereType = 'Aside' | 'Header'
export type LangType = 'zh-cn' | 'en'

export type ButtonShowType = 'text' | 'icon' | 'iconAndtext'

export type MainAnimationType =
    | 'slide-right'
    | 'slide-left'
    | 'el-fade-in-linear'
    | 'el-fade-in'
    | 'el-zoom-in-center'
    | 'el-zoom-in-top'
    | 'el-zoom-in-bottom'

export interface LayoutType {
    isFold: boolean
    isDark: boolean
    isGrey: boolean
    isColorWeak: boolean
    isTabs: boolean
    isShowBreadcrumb: boolean
    isMenuUniqueOpened: boolean

    mainAnimation: MainAnimationType

    layoutMode: LayoutModeType
    logoWhere: LogoWhereType
    size: SizeType

    isShowWatermark: boolean
    watermark: string[]
    watermarkColor: string[]

    isShowMainIcon: boolean
    isShowTabsIcon: boolean
    isShowBreadcrumbIcon: boolean
    isShowMenuIcon: boolean

    primaryColor: string
    predefinePrimaryColor: string[]
    predefineColors: string[]

    menuWidth: number
    subMenuWidth: number
    menuBackground: string[]
    menuBorderColor: string[]

    borderColor: string[]

    logoTextColor: string[]
    logoBackground: string[]
    logoHeight: number
    logoFontSize: number

    headerHeight: number
    headerBackground: string[]
    headerBorderColor: string[]
}

export interface langItemType {
    name: LangType
    value: string
}

export interface LocaleLangType {
    defaultLang: LangType
    fallbackLang: LangType
    langArray: langItemType[]
}

export interface TabItem {
    index: number // 此index仅记录tags显示顺序，移除左右侧tag使用, 数组本身的index作为路由跳转顺序使用
    icon: IconNameType
    title: string
    path: string
    name: string
}
export interface Tabs {
    isFullscreen: boolean
    activetabPath: string
    tabsArr: TabItem[]
}

export interface KeepAliveType {
    isRefresh: boolean
    keepAliveNames: string[]
}

export interface RouteMenuType {
    viewRoutes: RouteRecordRaw[]
    authRoutes: RouteRecordRaw[]
    authButtons: MenuType[]
}
/**
 * 当前登录的用户
 */
export interface AdminType {
    admin: AdminUserType
    menus: MenuType[]
    viewRoutes: RouteRecordRaw[]
    authRoutes: RouteRecordRaw[]
    authButtons: string[]
}
